//
//  BanJiKaoQingCell.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/15.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "BanJiKaoQingCell.h"

@implementation BanJiKaoQingCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
    }
    return self;
}

- (void)initSubView{
    self.backgroundColor = [UIColor yellowColor];
    CGFloat W = (705*fw)/9;
    for (int i = 0; i<9; i++) {
        if (i==8) {
            _checkButton = [UIButton buttonWithType:UIButtonTypeSystem];
            _checkButton.frame = CGRectMake(W*i+5, 5, W-10, 30);
            [_checkButton setTitle:@"查看" forState:UIControlStateNormal];
            [_checkButton setTitleColor:SELECTEDCOLOR forState:UIControlStateNormal];
            _checkButton.titleLabel.font = [UIFont systemFontOfSize:12];
            _checkButton.userInteractionEnabled  =YES;
            [self addSubview:_checkButton];
        }else{
            UILabel *label = [[UILabel alloc]init];
            label.frame = CGRectMake(W*i, 0, W, 40);
            label.text = @"11111";
            label.textAlignment = 1;
            label.textColor = TITLECOLOR;
            label.font = [UIFont systemFontOfSize:12];
            label.tag = 20+i;
            [self addSubview:label];
        }
    }
}
- (void)reloadViewLayout{
    CGFloat W = self.frame.size.width/9;
    for (int i = 0; i<9; i++) {
        if (i == 8) {
            _checkButton.frame = CGRectMake(W*i+5, 5, W-10, 30);
        }else{
            UILabel *label = (UILabel *)[self viewWithTag:i+20];
            label.frame = CGRectMake(W*i, 0, W, 40);
        }
    }
    
}
//- (void)lookUp:(UIButton *)sender{
//    self.checkBlock(self.index);
//}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
